package cn.sofwin.day0126.homework.Car;

import java.util.Scanner;

public class Test {
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {

        MotoVehicle motoVehicle;

        System.out.print("请选择需租赁的车型：（1.轿车 2.客车）");
        switch (sc.nextInt()){
            case 1:
                System.out.print("请输入车辆品牌：（别克商务舱GL8、宝马550i、别克林荫大道）");
                String brand = sc.next();
                if ("别克商务舱GL8".equals(brand) || "宝马550i".equals(brand) || "别克林荫大道".equals(brand)){
                    System.out.print("请输入车牌号：");
                    motoVehicle = new Car(sc.next(), brand);
                }else {
                    System.out.println("没有该品牌的车");
                    return;
                }
                break;
            case 2:
                System.out.print("请输入客车座位数量：");
                int seatCount = sc.nextInt();
                System.out.print("请输入车牌号：");
                motoVehicle = new Bus(sc.next(), seatCount);
                break;
            default:
                System.out.println("没有这样的车型");
                return;
        }

        System.out.print("请输入租赁天数：");
        System.out.println("租赁价格为：" + motoVehicle.CalcRent(sc.nextInt()) + "元");
    }
}
